<?php
/**
 * #Celebrate Shieh
 *             ,%%%%%%%%,
 *           ,%%/\%%%%/\%%
 *          ,%%%\c "" J/%%%
 * %.       %%%%/ o  o \%%%
 * `%%.     %%%%    _  |%%%
 *  `%%     `%%%%(__Y__)%%'
 *  //       ;%%%%`\-/%%%'
 * ((       /  `%%%%%%%'
 *  \\    .'          |
 *   \\  /       \  | |
 *    \\/         ) | |
 *     \         /_ | |__
 *     (___________))))))) 攻城湿
 *
 *        _       _
 * __   _(_)_   _(_) __ _ _ __
 * \ \ / / \ \ / / |/ _` |'_ \
 *  \ V /| |\ V /| | (_| | | | |
 *   \_/ |_| \_/ |_|\__,_|_| |_|
 */

namespace App\Models\Mongo;

use MongoDBQueue;

class Admin extends MongoDBQueue
{

    protected $connection = 'mongodb';

    protected $collection = 'admin';

    protected $fillable = [
        'id', 'ip', 'type', 'method', 'isAjax', 'module', 'url', 'browser', 'browser_version',
        'platform', 'platform_version', 'lang', 'os', 'mobile',
    ];

    static function CreateModel( $data )
    {
        return self::create($data);
    }

    static function PaginateModel()
    {
        return self::latest('created_at')->paginate((int) config('page.page'));
    }

    static function GetModel()
    {
        return self::all()->toArray();
    }

    static function DestroyModel( $id )
    {
        return self::destroy($id);
    }

    static function TruncateModel()
    {
        return self::truncate();
    }
}
